package com.iuie.ns.frame.utils;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class HttpUtils {

	/**
	 * 获取本机ip
	 * @return
	 * @throws Exception
	 */
	public static String getLocalIp(){
		String ip = "127.0.0.1";
		InetAddress address;
		try {
			address = InetAddress.getLocalHost();
			ip = address.getHostAddress().toString();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		}
		return ip;
	}
}
